home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / rexx / smacros.lha / FWMacros / Quick_Envelope.arexx < prev    next >
Text File  |  1994-12-17  |  3KB  |  110 lines

  1. /* Quick_Envelope
  2. A Macro by Steven. R. Giovenella, 5823 Dutchess Dr., Colorado Springs, CO 80918.
  3. © Copyright 1994 Steven. R. Giovenella, All rights reserved. 
  4. This macro is my gift to the Amiga community.  It may be given away free to 
  5. anyone, but it may NOT be sold in any way, shape, or form, not even for the cost of 
  6. reproduction, downloading, shipping, or handling, without express written 
  7. permission from the author listed above.  Any person or company who violates the 
  8. content of the previous sentence, agrees to pay Steven R. Giovenella $1,000 (US) for 
  9. each copy of this macro sold.  This macro may NOT be added to any disk which is to 
  10. be sold for any price or fee, to include shipping and handling.  The ONLY way this 
  11. macro may be distributed is on a disk which is given away 100% free of all charges, 
  12. or on via telecommunications networks which do not charge any additional fee as a 
  13. result of a user downloading this particular macro.  This macro may only be 
  14. reproduced in its entirety, including all comment lines and code.  The individual 
  15. user may alter this macro for personal use, but may not then distribute the macro 
  16. in any modified form.  If you wish, feel free to send me some cash, a Christmas card, 
  17. some other piece of software, or absolutely nothing as a gift for creating this macro.  
  18. The author of this software is not responsible for any data loss or damage to 
  19. computer equipment as a result, direct or indirect, of the use of this macro. */
  20.  
  21. Options Results
  22.  
  23. /* Determine if using a highlighted or a custom address  */
  24.     Status LinePos
  25.         Coords = Result
  26.         PARSE VAR Coords BegLine BegPos EndLine EndPos
  27.         If EndLine="" Then DO
  28.             CustomFlag=1
  29.             Endline=Begline
  30.             END
  31.         AddressLength = EndLine - BegLine
  32.  
  33. /* If custom, Request Address */
  34.         IF CustomFlag=1 THEN DO
  35.         DO i = 1 to 6
  36.             RequestText '"Custom Address (Line 'i' of 6)" "Enter text" ""'
  37.             If Result = "" Then Result = " "
  38.             address.i = Result
  39.             END
  40.         type " "
  41.         backspace
  42.         END
  43.  
  44. /* Highted data interpreter */
  45.     MoveToLine BegLine BegPos
  46.     ShiftDOWN
  47.     CtrlDOWN
  48.     AltDOWN
  49.     MoveToLine EndLine EndPos
  50.     Copy
  51.     ShiftUP
  52.     AltUp
  53.     CtrlUP
  54.  
  55. /* Check to see if no document is open 
  56.     Status FileName
  57.         IF Result = "" THEN flag = 1 */
  58.  
  59. /* Open Envelope Template */
  60.     RequestText '"Select Envelope Template to print on..." "Enter the template 
  61. name..." "Template_BusinessEnvelope"'
  62.         template = Result
  63.     file = "FWDocs/" || template
  64.     Open file
  65.     DO delay=1 to 2000
  66.         END
  67.     altdown
  68.     ctrldown
  69.     cursordown
  70.  
  71. /* Switch ARexx ports */
  72.     Status PortName
  73.         port = Result
  74.     portnumber = RIGHT(port,1) + 1
  75.     newport = "FINALW." || portnumber
  76.     IF flag =1 THEN newport = "FINALW.1"
  77.     ADDRESS VALUE newport 
  78.     
  79. /* Paste or Write Addess */
  80.     altdown
  81.     ctrldown
  82.     cursor down
  83.     Status LinePos
  84.         coords = Result
  85.         PARSE VAR coords Line Pos
  86.     copyruler
  87.     If CustomFlag = 1 Then Call SkipPaste
  88.     Paste
  89.     Do i = 0 to addresslength
  90.         MoveToLine (Line+i) Pos
  91.         pasteruler
  92.         End
  93.     Print PROMPT
  94.     Close FORCE
  95.     EXIT
  96.  
  97. SkipPaste:
  98.     DO i = 1 to 6
  99.         type address.i
  100.         newparagraph
  101.         END
  102.     Do i = 0 to addresslength
  103.         MoveToLine (Line+i) Pos
  104.         pasteruler
  105.         End
  106.     Print PROMPT
  107.     Close FORCE
  108.     EXIT
  109.     
  110.